<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <artifactId>{{projectName}}</artifactId>
        <groupId>{{packageName}}</groupId>
        <version>{{system.pub.versionString}}</version>
    </parent>

    <artifactId>{{projectName}}-core</artifactId>
    <name>{{projectDesc}} Core</name>
    <description>{{system.memo}} Core，模板生成代码，再次发布会覆盖，建议不要直接修改，修改请在{{projectName}}-usr {{#each system.apis}}{{projectName}}-{{lowerCase codeName}} {{/each}}项目中继承或覆盖重写</description>

    <dependencies>

        <dependency>
            <groupId>cn.ibizlab.plugin</groupId>
            <artifactId>ibizlab-boot-starter-data</artifactId>
            <version>${ibizlab-boot-starter.version}</version>
        </dependency>

        {{#system.enableES}}
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-elasticsearch</artifactId>
        </dependency>

        {{/system.enableES}}
        {{#system.enableMQ}}
        <dependency>
            <groupId>org.apache.rocketmq</groupId>
            <artifactId>rocketmq-client</artifactId>
            <version>4.7.0</version>
        </dependency>

        {{/system.enableMQ}}
        {{#system.enableOAuth2}}
        <dependency>
            <groupId>org.springframework.security.oauth</groupId>
            <artifactId>spring-security-oauth2</artifactId>
            <version>2.3.6.RELEASE</version>
        </dependency>

        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-jwt</artifactId>
            <version>1.0.10.RELEASE</version>
        </dependency>
        
        {{/system.enableOAuth2}}
        {{#system.enableOracle}}
        <!--  Oracle驱动包 -->
        <dependency>
            <groupId>com.oracle.database.jdbc</groupId>
            <artifactId>ojdbc8</artifactId>
        </dependency>

        <dependency>
            <groupId>com.oracle.database.nls</groupId>
            <artifactId>orai18n</artifactId>
        </dependency>

        {{/system.enableOracle}}
        {{#system.enablePostgreSQL}}
        <!--  PostgreSQL驱动包 -->
        <dependency>
            <groupId>org.postgresql</groupId>
            <artifactId>postgresql</artifactId>
        </dependency>

        {{/system.enablePostgreSQL}}
        {{#system.enableMysql}}
        <!--  MySQL驱动包 -->
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
        </dependency>

        {{/system.enableMysql}}
        {{#system.enableDELogic}}
        <!--  实体处理逻辑：JBPM + Drools   -->
        <dependency>
            <groupId>org.jbpm</groupId>
            <artifactId>jbpm-flow-builder</artifactId>
            <version>7.23.0.Final</version>
        </dependency>

        <dependency>
            <groupId>org.jbpm</groupId>
            <artifactId>jbpm-bpmn2</artifactId>
            <version>7.23.0.Final</version>
        </dependency>

        <dependency>
            <groupId>org.flowable</groupId>
            <artifactId>flowable-bpmn-converter</artifactId>
            <version>6.4.2</version>
        </dependency>

        <dependency>
            <groupId>org.drools</groupId>
            <artifactId>drools-core</artifactId>
            <version>7.23.0.Final</version>
        </dependency>

        <dependency>
            <groupId>org.drools</groupId>
            <artifactId>drools-compiler</artifactId>
            <version>7.23.0.Final</version>
        </dependency>

        <dependency>
            <groupId>org.drools</groupId>
            <artifactId>drools-decisiontables</artifactId>
            <version>7.23.0.Final</version>
        </dependency>

        <dependency>
            <groupId>org.kie</groupId>
            <artifactId>kie-spring</artifactId>
            <version>7.23.0.Final</version>
        </dependency>

        <dependency>
            <groupId>org.kie</groupId>
            <artifactId>kie-api</artifactId>
            <version>7.23.0.Final</version>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
        </dependency>

        {{/system.enableDELogic}}
        {{#system.enableGlobalTransaction}}
        <!--  阿里seata分布式事务 -->
        <dependency>
            <groupId>io.seata</groupId>
            <artifactId>seata-spring-boot-starter</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>com.alibaba</groupId>
                    <artifactId>druid</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>com.alibaba.cloud</groupId>
            <artifactId>spring-cloud-starter-alibaba-seata</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>io.seata</groupId>
                    <artifactId>seata-spring-boot-starter</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        {{/system.enableGlobalTransaction}}
	</dependencies>

    <properties>
        <maven.build.timestamp.format>yyyyMMddHHmmss</maven.build.timestamp.format>
    </properties>
    <profiles>
        <profile>
            <id>diff</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.liquibase</groupId>
                        <artifactId>liquibase-maven-plugin</artifactId>
                        <version>${liquibase.version}</version>
                        <dependencies>
                            <dependency>
                                <groupId>com.h2database</groupId>
                                <artifactId>h2</artifactId>
                                <version>1.4.200</version>
                            </dependency>
                        </dependencies>
                        <executions>
                            <execution>
                                <id>prepare-newdb</id>
                                <configuration>
                                    <changeLogFile>${project.basedir}/src/main/resources/liquibase/h2_table.xml</changeLogFile>
                                    <driver>org.h2.Driver</driver>
                                    <url>jdbc:h2:file:${project.build.directory}/db/new;MODE=mysql</url>
                                    <username>root</username>
                                    <dropFirst>true</dropFirst>
                                </configuration>
                                <phase>process-resources</phase>
                                <goals>
                                    <goal>update</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>prepare-olddb</id>
                                <configuration>
                                    <changeLogFile>${project.basedir}/src/main/resources/liquibase/master_table.xml</changeLogFile>
                                    <driver>org.h2.Driver</driver>
                                    <url>jdbc:h2:file:${project.build.directory}/db/last;MODE=mysql</url>
                                    <username>root</username>
                                    <dropFirst>true</dropFirst>
                                </configuration>
                                <phase>process-resources</phase>
                                <goals>
                                    <goal>update</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>make-diff</id>
                                <configuration>
                                    <changeLogFile>${project.basedir}/src/main/resources/liquibase/empty.xml</changeLogFile>
                                    <diffChangeLogFile>${project.basedir}/src/main/resources/liquibase/changelog/${maven.build.timestamp}_changelog.xml</diffChangeLogFile>
                                    <driver>org.h2.Driver</driver>
                                    <url>jdbc:h2:file:${project.build.directory}/db/last;MODE=mysql</url>
                                    <username>root</username>
                                    <password></password>
                                    <referenceUrl>jdbc:h2:file:${project.build.directory}/db/new;MODE=mysql</referenceUrl>
                                    <referenceDriver>org.h2.Driver</referenceDriver>
                                    <referenceUsername>root</referenceUsername>
                                    <verbose>true</verbose>
                                    <logging>debug</logging>
                                    <contexts>!test</contexts>
                                    <diffExcludeObjects>Index:.*,foreignKey:.*,table:ibzfile,ibzuser,ibzdataaudit,ibzcfg,IBZFILE,IBZUSER,IBZDATAAUDIT,IBZCFG,act_de_databasechangelog,act_de_databasechangeloglock,act_de_model,act_de_model_history,act_de_model_relation,ACT_DE_DATABASECHANGELOG,ACT_DE_DATABASECHANGELOGLOCK,ACT_DE_MODEL,ACT_DE_MODEL_HISTORY,ACT_DE_MODEL_RELATION</diffExcludeObjects>
                                </configuration>
                                <phase>process-resources</phase>
                                <goals>
                                    <goal>diff</goal>
                                </goals>
                            </execution>
                        </executions>

                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>
